package com.itheima06;

import java.util.concurrent.Callable;

public class Test {
    public static void main(String[] args) {
        method(new Cat());
        method(new Dog());
    }

    public static void method(Animal a) {
        a.eat();
        if (a instanceof Cat) {
            //Cat c =(Cat) a;
            ((Cat) a).catchMouse();
        }
        if (a instanceof Dog) {
           // Dog d = (Dog) a;
            ((Dog) a).lookHome();
        }
    }
}
